/**
 * 
 */
package com.google.code.netz.wfe.api;

/**
 * Context that provides a contract to declare(store) and retrieve variables to
 * allow building expressions
 * 
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @since 1.0
 * @version $Id$
 */
public interface IContext {

	/**
	 * Declares a variable for a specified type in this context.
	 * 
	 * @param <T>
	 * @param klass
	 * @param varName
	 * @param value
	 * @throws DuplicateContextVariableDeclarationException
	 */
	public <T> void declare(Class<T> klass, String varName, T value)
			throws DuplicateContextVariableDeclarationException;

	/**
	 * For a specified type <T> attempts to obtain a variable value for the
	 * speified variable name.
	 * 
	 * @param <T>
	 * @param klass
	 * @param name
	 * @return
	 * @throws ContextVariableNotFoundException
	 */
	public <T> T get(Class<T> klass, String name) throws ContextVariableNotFoundException;

}
